import request from '@/utils/httpRequest'

export function fetchList(query) {
  return request({
    url: request.adornUrl('/shop/shops/page'),
    method: 'get',
    params: query
  })
}

export function getAllShops(data) {
  return request({
    url: request.adornUrl('/shop/shops/getAllShops'),
    method: 'post',
    data
  })
}

export function getShopsByType(data) {
  return request({
    url: request.adornUrl('/shop/shops/getShopsByType'),
    method: 'post',
    data
  })
}

export function getShopListByMerTypeId(data) {
  return request({
    url: request.adornUrl('/shop/shops/getShopListByMerTypeId'),
    method: 'post',
    data
  })
}

export function addObj(obj) {
  return request({
    url: request.adornUrl('/shop/shops/saveShop'),
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: request.adornUrl('/shop/shops/' + id),
    method: 'get'
  })
}

export function delObj(id) {
  return request({
    url: request.adornUrl('/shop/shops/' + id),
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: request.adornUrl('/shop/shops'),
    method: 'put',
    data: obj
  })
}

export function search(data) {
  return request({
    url: request.adornUrl('/delivery/deliveryman/searchDelivery'),
    method: 'post',
    data
  })
}
